{	Problem: http://codeforces.ru/problemset/problem/47/B
	Verdict: Accepted

}
var n,i,cur,res:longint; s:string; data:array['A'..'C'] of integer;
begin
readln(s);
res:=0;
data['A']:=0;
data['B']:=0;
data['C']:=0;
if s[2]='>' then begin
  inc(data[s[1]]);
  dec(data[s[3]]);
end else begin
  dec(data[s[1]]);
  inc(data[s[3]]);
end;
readln(s);
if s[2]='>' then begin
  inc(data[s[1]]);
  dec(data[s[3]]);
end else begin
  dec(data[s[1]]);
  inc(data[s[3]]);
end;
readln(s);
if s[2]='>' then begin
  if data[s[3]]>data[s[1]] then res:=-1 else begin
    inc(data[s[1]]);
    dec(data[s[3]]);
  end;
end else begin 
  if data[s[1]]>data[s[3]] then res:=-1 else begin
    dec(data[s[1]]);
    inc(data[s[3]]);
  end;
end;
if res=-1 then writeln('Impossible') else begin
  if (data['A']<data['B']) and (data['A']<data['C']) then begin
    write('A');
    data['A']:=-100;
    if data['C']<data['B'] then write('CB') else write('BC');
  end else
  if (data['A']>data['B']) and (data['B']<data['C']) then begin
    write('B');
    data['B']:=-100;
    if data['A']<data['C'] then write('AC') else write('CA');
  end else
  if (data['C']<data['B']) and (data['A']>data['C']) then begin
    write('C');
    data['C']:=-100;
    if data['A']<data['B'] then write('AB') else write('BA');
  end;
end;
readln;
end.